package com.lm.activiti.boot.cases;

import com.google.common.collect.Lists;
import com.lm.activiti.boot.cases.dto.AProperties;
import com.lm.activiti.boot.cases.dto.ParentProperties;
import org.junit.Test;

import java.util.Collection;
import java.util.List;

/**
 * @author lm_jcf
 * @date 2020/4/21 16:15
 */
public class PolymorphicTest {


    @Test
    public void exchangeList() {

        ParentProperties properties = new ParentProperties();
        properties.setName("李白");

        List<ParentProperties> propertiesList = Lists.newArrayList(properties);

        List<AProperties> aProperties = Lists.newArrayList();


        System.out.println(aProperties);
    }

    @Test
    public void exchangePointer() {
        Integer a = null;
        Integer b = null;
        Integer c = 23;

        a = b;
        b = c;

        System.out.println(a);

        ParentProperties p_a = null;
        ParentProperties p_b = null;
        ParentProperties p_c = new ParentProperties();
        p_c.setName("张三");

        p_a = p_b;
        p_b = p_c;

        System.out.println(p_a);
    }

}
